package com.cipe.cmrs.model.view;

import java.io.Serializable;
import java.math.BigDecimal;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

import org.apache.commons.lang.builder.HashCodeBuilder;

import com.cipe.cmrs.util.NumberUtil;

@Entity
@Table(name = "vw_paymentrequest")
public class PaymentRequestView implements Serializable {

    /**
     * 
     */
    private static final long serialVersionUID = -4009817209524653667L;

    @Id
    @Column(name = "projectid")
    private Integer projectId;

    @Id
    @Column(name = "paymentrequestid")
    private Integer paymentRequestId;

    @Column(name = "totalamount")
    private BigDecimal totalAmount;

    public Integer getProjectId() {
        return projectId;
    }

    public void setProjectId(Integer projectId) {
        this.projectId = projectId;
    }

    public Integer getPaymentRequestId() {
        return paymentRequestId;
    }

    public void setPaymentRequestId(Integer paymentRequestId) {
        this.paymentRequestId = paymentRequestId;
    }

    public BigDecimal getTotalAmount() {
        return totalAmount;
    }

    public void setTotalAmount(BigDecimal totalAmount) {
        this.totalAmount = totalAmount;
    }

    public boolean equals(Object obj) {
        PaymentRequestView prv = (PaymentRequestView) obj;
        return prv != null && NumberUtil.INSTANCE.isEqual(projectId, prv.projectId)
            && NumberUtil.INSTANCE.isEqual(paymentRequestId, prv.getPaymentRequestId());
    }

    public int hashCode() {
        return new HashCodeBuilder().appendSuper(super.hashCode()).append(projectId).append(paymentRequestId).toHashCode();
    }
}
